package com.iv.durian.cloud.facade;

import com.iv.durian.cloud.LessonDetail;
import com.iv.durian.cloud.Serve;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * Created by zlw on 2018-07-01.
 */
@Component
@FeignClient(name = Serve.SERVICE_NAME)
@RequestMapping("/service/lessonDetail")
public interface LessonDetailFacade {

    @RequestMapping(path = "/getById/{lesson_id}", method = RequestMethod.GET)
    LessonDetail getById(@PathVariable(value = "lesson_id")Integer lessonId);

    @RequestMapping(path = "/getByName/{lesson_name}", method = RequestMethod.GET)
    LessonDetail getByName(@PathVariable(value = "lesson_name") String lessonName);

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    void add( @RequestBody LessonDetail lessonDetail);

    @RequestMapping(value = "/removeLessonDetailById/{lesson_id}", method = RequestMethod.POST)
    void removeById( @PathVariable("lesson_id")Integer lessonId);

    @RequestMapping(value = "/updateLesson/{lesson_id}/{lesson_name}", method = RequestMethod.POST)
    int updateLessonDetail( @RequestBody LessonDetail lessonDetail);

    /*@RequestMapping(value = "/listLesson/{lesson_id}/{status}/{offset}/{limit}", method = RequestMethod.GET)
    List<LessonDetail> list(@PathVariable("lesson_id")Integer lessonId, @PathVariable("status")Integer status,@PathVariable("offset") Integer offset, @PathVariable("limit") Integer limit);*/

    @RequestMapping(value = "/countLessonDetail/{lesson_id}", method = RequestMethod.GET)
    int countLessonDetail(@PathVariable("lesson_id")Integer lessonId);

}
